package com.tyx.common.exception;

public enum EffStateEnum {
    EFFECTIVE(1,"有效"),
    INVALID(2,"无效"),
    REVOKE(3,"撤销"),
    OTHER(4,"其他")
    ;


    EffStateEnum(Integer code, String msg){
        this.code = code;
        this.msg = msg;
    }

    public static String getName(int index) {
        for (EffStateEnum c : EffStateEnum.values()) {
            if (c.getCode() == index) {
                return c.msg;
            }
        }
        return null;
    }
    /**
     * 错误代码
     */
    private Integer code;

    /**
     * 错误消息
     */
    private String msg;

    /** 错误代码 */
    public Integer getCode() {
        return code;
    }

    /** 错误代码 */
    public void setCode(Integer code) {
        this.code = code;
    }

    /** 错误消息 */
    public String getMsg() {
        return msg;
    }

    /** 错误消息 */
    public void setMsg(String msg) {
        this.msg = msg;
    }
}
